package lihua.robot.controller;


import lihua.robot.common.Result;
import lihua.robot.utils.PostManUtil;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping(value="/robot_control_power")
public class PowerControl {


    /**
     * 获取机器人控制权
     * @return
     */

    @RequestMapping("/obtaining_control")
    public Result Obtaining_Control(List<Map<String,Object>> vehicles){
        PostManUtil.sendPowerPost(vehicles);
        return Result.success();
    }

    /**
     * 释放机器人控制权
     * @return
     */

    @RequestMapping("/release_control")
    public Result Release_Control(List<Map<String,Object>> vehicles){
        PostManUtil.sendReleasePowerPost(vehicles);
        return Result.success();
    }
}
